package rest.jbpm.wrappers;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

@XmlRootElement
@XmlAccessorType(XmlAccessType.PROPERTY)
@XmlType(name = "duration", propOrder = {
    "activity",
    "duration"
})
public class Duration {
	
	private String activity;
	private Number milliseconds;
	
	protected Duration() {
	}

	public Duration(String activity, Number milliseconds) {
		this.activity = activity;
		this.milliseconds = milliseconds;
	}
	
    @XmlElement(required = true)
    public long getDuration() {
        return milliseconds.longValue();
    }
    
    @XmlElement(required = true)
    public String getActivity() {
        return activity;
    }
	
}
